-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add S.fromEither to pull out values from either #229
Add S.fromEither to pull out values from either #229
Conversation
d269f79
to
fea90f9
Compare
Thank you, @wennergr! This was a nice surprise. :) |
The order in which the functions appear in the source file determines the order in which the functions are listed in the documentation, so it's nice to group related functions. In this case, let's follow the (somewhat arbitrary) precedent set by |
|
||
it('type checks its arguments', function() { | ||
throws(function() { S.fromEither(0, [1, 2, 3]); }, | ||
'Invalid value\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's adjust the indentation like so:
throws(function() { S.fromEither(0, [1, 2, 3]); },
'Invalid value\n' +
Thanks for your feedback I did not do property based tests because the fromMaybe tests didn't. Is it only used to test laws? Performance reasons? More then happy to change ;) Also more then happy to rebase before the merge. |
The truthful answer is that property-based testing is still relatively new to me, so I don't think to use it. While it would be great to add more property-based tests, that's a larger change orthogonal to this one.
That would be marvellous. :) I'd like to add that I ❤️ the way in which you went about this pull request. You matched the existing code and documentation style, and referenced the issue this pull request will close. Very nice! |
S.fromEither :: b -> Either a b -> b Closes: sanctuary-js#130
8ce285c
to
be1f26e
Compare
Done, and thanks! |
🌳 |
|
S.fromEither :: b -> Either a b -> b
Closes: #130